package com.fcwy.puzzle;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.os.Handler;
import android.widget.ImageView;

import com.fcwy.puzzle.utils.HImage;
import com.fcwy.puzzle.utils.PathUtil;
import com.umeng.analytics.MobclickAgent;

public class StartActivity extends Activity {

	private ImageView imgv_content;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);		
		setContentView(R.layout.activity_welcome);
		imgv_content=(ImageView)this.findViewById(R.id.imgv_content);
		try{
			//启动页图片
//			Bitmap bitmap=HImage.getLocalBitMap(null,PathUtil.LOGO_KEY_FILE_PATH,false);
//			if(bitmap!=null){
//				imgv_content.setImageBitmap(bitmap);
//			}else{
				imgv_content.setImageResource(R.drawable.welcome);
			//}
		}catch(Exception e){
			//Toast.makeText(this, e.getMessage(), 1000).show();
		}				
		new Handler().postDelayed(new Runnable() {
			@Override
			public void run() {
				Intent intent = new Intent(StartActivity.this,MainActivity.class);
				startActivity(intent);				
				finish();					
			}
		}, 2000);
	}

	@Override
	public void onBackPressed() {
		//islogin = false;
		super.onBackPressed();
	}
	
	public void onResume() {
		super.onResume();
		MobclickAgent.onResume(this);
	}
//
	public void onPause() {
		super.onPause();
		MobclickAgent.onPause(this);
	}
}
